home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
c_news
/
16
/
sets
/
setsourc
/
chsettyp.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-03-09
|
1KB
|
30 lines
#include <stdio.h>
#include <stdarg.h>
#include "sets.h"
/***************************************************************************/
int check_set_types(set *set1, set *set2)
/***************************************************************************/
/* Type checking is done here in three ways:
The base_types of destination and source must be the same and both
destination and source must have the same set_size and set tag. UNLESS,
of course, one of the base_types is UNIVERSAL.
*/
{
if(set1->base_type == set2->base_type &&
set1->set_size == set2->set_size &&
set1->set_tag == set2->set_tag)
return SUCCESS;
else if(set1->base_type == UNIVERSAL &&
set1->set_size >= set2->set_size &&
set1->set_tag == set2->set_tag)
return SUCCESS;
else if(set2->base_type == UNIVERSAL &&
set2->set_size >= set1->set_size &&
set2->set_tag == set1->set_tag)
return SUCCESS;
else
return FAILURE;
} /* end check_set_types */